Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helm & e2e: add option to enable read affinity for rbd #4111

Merged
merged 2 commits into from
Sep 26, 2023

Conversation

iPraveenParihar
Copy link
Contributor

@iPraveenParihar iPraveenParihar commented Sep 7, 2023

Describe what this PR does

  • helm: add option to enable read affinity for rbd
    This commit adds --enable-read-affinity flag to
    enable read affinity for rbd

  • e2e: added test to verify read affinity functionality
    e2e test case is added to test if read affinity is enabled by
    verifying read_from_replica=localize option is passed.

Closes: #3642


@mergify mergify bot added the component/deployment Helm chart, kubernetes templates and configuration Issues/PRs label Sep 7, 2023
Comment on lines 291 to 297
- topology.rook.io/datacenter
- topology.rook.io/room
- topology.rook.io/pod
- topology.rook.io/pdu
- topology.rook.io/row
- topology.rook.io/rack
- topology.rook.io/chassis
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just have the above labels as examples.
These rook specific labels can be removed.

Comment on lines 90 to 91
{{- if .Values.readAffinity.enabled }}
- "--enable-read-affinity=true"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be problematic if we choose to enable it by default later for some reason and the user should be able to disable it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Madhu-1, I didn't get you on this. Can you explain bit more?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{{- if .Values.readAffinity.enabled }}
- "--enable-read-affinity=true"
- "--enable-read-affinity={{ .Values.readAffinity.enabled }}"
{{- if .Values.readAffinity.enabled }}
- "--crush-location-labels={{ .Values.readAffinity.crushLocationLabels | join "," }}"
{{- end }}

The above change will allow users to disable the ReadAffinity if its get enabled by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I got it
Thanks!

@@ -176,6 +176,8 @@ charts and their default values.
| `provisioner.podSecurityPolicy.enabled` | Specifies whether podSecurityPolicy is enabled | `false` |
| `topology.enabled` | Specifies whether topology based provisioning support should be exposed by CSI | `false` |
| `topology.domainLabels` | DomainLabels define which node labels to use as domains for CSI nodeplugins to advertise their domains | `{}` |
| `readAffinity.enabled` | Enable read affinity for RBD volumes. Recommended to set to true if running kernel 5.8 or newer. | `false` |
| `readAffinity.crushLocationLabels` | Define which node labels to use as CRUSH location. This should correspond to the values set in the CRUSH map. | labels listed [here](https://github.com/rook/rook/blob/master/Documentation/CRDs/Cluster/ceph-cluster-crd.md#osd-topology) |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you point to the ceph doc instead of the Rook doc for this one? if not, this can never be used with regular ceph clusters?

Copy link
Contributor

@Rakshith-R Rakshith-R Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Praveen, The default is empty list [],

add a sentence "For more information, click [here]"
https://github.com/ceph/ceph-csi/blob/v3.9.0/docs/deploy-rbd.md#read-affinity-using-crush-locations-for-rbd-volumes

Users can refer to this section for more details

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rakshith-R, I have made the changes

@iPraveenParihar iPraveenParihar marked this pull request as ready for review September 13, 2023 13:25
@iPraveenParihar iPraveenParihar force-pushed the read-affinity/e2e-and-helm branch 4 times, most recently from 0e4176a to d1d3627 Compare September 14, 2023 08:08

// enable read affinity support (for RBD)
enableReadAffinity bool
crushLocationLabels string
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Madhu-1,
golangci-lint is faling because of maligned struct

e2e/deployment.go:233:29: struct of size 80 bytes could be of size 72 bytes:
struct{
	filename           	string,
	namespace          	string,
	domainLabel        	string,
	crushLocationLabels	string,
	oneReplica         	bool,
	enableTopology     	bool,
	enableReadAffinity 	bool,
}
``` (maligned)
type yamlResourceNamespaced struct {

Do we reorder as suggested?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it's best to do it as suggested.

@iPraveenParihar iPraveenParihar force-pushed the read-affinity/e2e-and-helm branch 2 times, most recently from 78b0ab9 to 2cdf37f Compare September 14, 2023 11:21
@iPraveenParihar
Copy link
Contributor Author

/test ci/centos/mini-e2e/k8s-1.26

@iPraveenParihar
Copy link
Contributor Author

/test ci/centos/mini-e2e-helm/k8s-1.26

@iPraveenParihar
Copy link
Contributor Author

/test ci/centos/mini-e2e-helm/k8s-1.27

@iPraveenParihar
Copy link
Contributor Author

/test ci/centos/mini-e2e/k8s-1.27

@iPraveenParihar
Copy link
Contributor Author

/test ci/centos/mini-e2e/k8s-1.28

@iPraveenParihar
Copy link
Contributor Author

/test ci/centos/mini-e2e-helm/k8s-1.28

@iPraveenParihar
Copy link
Contributor Author

iPraveenParihar commented Sep 14, 2023

@Rakshith-R,
For the e2e test case - verifying just the presence of the read_from_replica=localize option is enough?
As the crush location label:value will be in random order.

example - crush_location=zone:east-zone1|region:east or it may be crush_location=region:east|zone:east-zone1.
In this case, I'll have to parse thecrush_location value and then verify each label:value individually

@Rakshith-R
Copy link
Contributor

@Rakshith-R, For the e2e test case - verifying just the presence of the read_from_replica=localize option is enough? As the crush location label:value will be in random order.

example - crush_location=zone:east-zone1|region:east or it may be crush_location=region:east|zone:east-zone1. In this case, I'll have to parse thecrush_location value and then verify each label:value individually

It'll be great to parse and verify the key value pairs too.

@iPraveenParihar iPraveenParihar force-pushed the read-affinity/e2e-and-helm branch 3 times, most recently from feee4ed to ae0d73b Compare September 19, 2023 04:01
@iPraveenParihar
Copy link
Contributor Author

/test ci/centos/mini-e2e/k8s-1.26

@iPraveenParihar
Copy link
Contributor Author

/test ci/centos/mini-e2e/k8s-1.27

@iPraveenParihar
Copy link
Contributor Author

/test ci/centos/mini-e2e/k8s-1.28

1 similar comment
@iPraveenParihar
Copy link
Contributor Author

/test ci/centos/mini-e2e/k8s-1.28

@iPraveenParihar
Copy link
Contributor Author

/test ci/centos/mini-e2e-helm/k8s-1.26

@iPraveenParihar
Copy link
Contributor Author

/test ci/centos/mini-e2e-helm/k8s-1.27

@iPraveenParihar
Copy link
Contributor Author

/test ci/centos/mini-e2e-helm/k8s-1.28

Madhu-1
Madhu-1 previously approved these changes Sep 25, 2023
Rakshith-R
Rakshith-R previously approved these changes Sep 25, 2023
This commit adds --enable-read-affinity flag to
enable read affinity for rbd

Signed-off-by: Praveen M <m.praveen@ibm.com>
e2e test case is added to test if read affinity is enabled by
verifying read_from_replica=localize option is passed

Signed-off-by: Praveen M <m.praveen@ibm.com>
@mergify mergify bot dismissed stale reviews from Rakshith-R and Madhu-1 September 26, 2023 04:24

Pull request has been modified.

@Rakshith-R
Copy link
Contributor

@iPraveenParihar you can use https://docs.mergify.com/commands/rebase to rebase, It'll preserve the approvals.

@iPraveenParihar
Copy link
Contributor Author

@Mergifyio queue

@mergify
Copy link
Contributor

mergify bot commented Sep 26, 2023

queue

❌ Command disallowed due to command restrictions in the Mergify configuration.

  • sender-permission>=write

@Rakshith-R
Copy link
Contributor

@Mergifyio queue

@mergify
Copy link
Contributor

mergify bot commented Sep 26, 2023

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at 6719d64

@mergify mergify bot added the ok-to-test Label to trigger E2E tests label Sep 26, 2023
@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.28

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.26

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/upgrade-tests-cephfs

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.28

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.26

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e/k8s-1.28

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/upgrade-tests-rbd

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.27

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e/k8s-1.26

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.27

@ceph-csi-bot
Copy link
Collaborator

/test ci/centos/mini-e2e/k8s-1.27

@ceph-csi-bot ceph-csi-bot removed the ok-to-test Label to trigger E2E tests label Sep 26, 2023
@mergify mergify bot merged commit 6719d64 into ceph:devel Sep 26, 2023
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/deployment Helm chart, kubernetes templates and configuration Issues/PRs component/testing Additional test cases or CI work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

e2e & helm options: rbd: add capability to automatically enable read affinity
4 participants